
#include  "F28x_Project.h"
#include "IGBT_Temp.h"

float IGBT_TempCalc(float IGBTVolt)
{
   if (IGBTVolt>Temp0)return  0;
   else if ((IGBTVolt>Temp2)&&(IGBTVolt<=Temp0))return  8;
   else if ((IGBTVolt>Temp4)&&(IGBTVolt<=Temp2))return  10;
   else if ((IGBTVolt>Temp6)&&(IGBTVolt<=Temp4))return  12;
   else if ((IGBTVolt>Temp8)&&(IGBTVolt<=Temp6))return  15;
   else if ((IGBTVolt>Temp10)&&(IGBTVolt<=Temp8))return  20;
   else if ((IGBTVolt>Temp12)&&(IGBTVolt<=Temp10))return  25;
   else if ((IGBTVolt>Temp14)&&(IGBTVolt<=Temp12))return  30;
   else if ((IGBTVolt>Temp16)&&(IGBTVolt<=Temp14))return  38;
   else if ((IGBTVolt>Temp18)&&(IGBTVolt<=Temp16))return  52;
   else if ((IGBTVolt>Temp20)&&(IGBTVolt<=Temp18))return  72;
   else if ((IGBTVolt>Temp22)&&(IGBTVolt<=Temp20))return  75;
   else if ((IGBTVolt>Temp24)&&(IGBTVolt<=Temp22))return  80;
   else if ((IGBTVolt>Temp26)&&(IGBTVolt<=Temp24))return  85;
   else if ((IGBTVolt>Temp28)&&(IGBTVolt<=Temp26))return  91;
   else if ((IGBTVolt>Temp30)&&(IGBTVolt<=Temp28))return  99;
   else if ((IGBTVolt>Temp32)&&(IGBTVolt<=Temp30))return  105;
   else if ((IGBTVolt>Temp34)&&(IGBTVolt<=Temp32))return  120;
   else if ((IGBTVolt>Temp36)&&(IGBTVolt<=Temp34))return  135;
   else return 100;
}
